package com.insurance.service.impl;

import com.insurance.dao.PartnerLoginLogDao;
import com.insurance.entity.PartnerLoginLogEntity;
import com.insurance.service.PartnerLoginLogService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.insurance.common.utils.PageUtils;
import com.insurance.common.utils.Query;


@Service("partnerLoginLogService")
public class PartnerLoginLogServiceImpl extends ServiceImpl<PartnerLoginLogDao, PartnerLoginLogEntity> implements PartnerLoginLogService {

    @Override
    public PageUtils queryPage(Map<String, Object> params, QueryWrapper<PartnerLoginLogEntity> queryWrapper) {
        IPage<PartnerLoginLogEntity> page = this.page(new Query<PartnerLoginLogEntity>().getPage(params), queryWrapper);
        return new PageUtils(page);
    }

    @Override
    public QueryWrapper<PartnerLoginLogEntity> getQueryWrapper(PartnerLoginLogEntity partnerLoginLogEntity){
        QueryWrapper<PartnerLoginLogEntity> queryWrapper = new QueryWrapper<PartnerLoginLogEntity>();
        if(!StringUtils.isBlank(partnerLoginLogEntity.getAppId())){
            queryWrapper.eq("app_id", partnerLoginLogEntity.getAppId());
        }
        return queryWrapper;
    }


}